<?php
/**
 * Pert Library
 * UploadedDocument Class
 *
 * @author	Emre Hasegeli <hasegeli@gmail.com>
 * @license	GNU General Public License v3
 */

namespace Pert;

class UploadedDocument extends UploadedFile
{
	const minSize = 20000;

	protected function minSizeControl() //After PHP 5.3 this can be handled in parent class's exception function
	{
		if($this->size <= self::minSize)
			throw new FileUploadException('The uploaded file is too small.');
	}

	protected function typeException($type)
	{
		if($this->extension != 'pdf')
			throw new FileUploadException('The uploaded file\'s extension is not \'pdf\'.');

		if($type != 'application/pdf')
			throw new FileUploadException('The uploaded file is not a PDF.');
	}
}
